package com.yurun.orderservice.tcc;

import com.yurun.domain.OrderTb;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * @author Xi Gao
 * @date 2020/9/13 11:55
 */
@LocalTCC
public interface OrderActionService {

    @TwoPhaseBusinessAction(name = "saveOrder", commitMethod = "mycommit", rollbackMethod = "myrollBack")
    boolean saveOrder(BusinessActionContext context, @BusinessActionContextParameter(paramName = "orderInfo") OrderTb orderTb);

    boolean mycommit(BusinessActionContext context);

    boolean myrollBack(BusinessActionContext context);

}
